Skip to main content

Documentation Index

Fetch the complete documentation index at: https://superdoc-dependabot-npm_and_yarn-npm_and_yarn-e04d5d616f.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Get Started with SuperDoc API

Follow this guide to make your first API request and convert a DOCX file to PDF.

Prerequisites

Before you begin, you’ll need:

Step 1: Get Your API Key

1

Sign Up

Create a free account at dashboard.superdoc.dev
2

Generate API Key

Navigate to the API Keys section and create a new key
3

Copy Your Key

Copy your API key. It will look like: sd_live_pk_...
Keep your API key secure and never commit it to version control. Use environment variables in production.

Step 2: Make Your First Request

Using cURL

curl -X POST https://api.superdoc.dev/v1/convert?format=pdf \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "file=@path/to/your/document.docx" \
  -o converted.pdf

Using JavaScript

const FormData = require("form-data");
const fs = require("fs");
const fetch = require("node-fetch");

const form = new FormData();
form.append("file", fs.createReadStream("document.docx"));

const response = await fetch("https://api.superdoc.dev/v1/convert?format=pdf", {
  method: "POST",
  headers: {
    Authorization: "Bearer YOUR_API_KEY",
    ...form.getHeaders(),
  },
  body: form,
});

const pdfBuffer = await response.buffer();
fs.writeFileSync("converted.pdf", pdfBuffer);

Using Python

import requests

with open('document.docx', 'rb') as f:
    files = {'file': ('document.docx', f, 'application/vnd.openxmlformats-officedocument.wordprocessingml.document')}
    headers = {'Authorization': 'Bearer YOUR_API_KEY'}

    response = requests.post(
        'https://api.superdoc.dev/v1/convert?format=pdf',
        headers=headers,
        files=files
    )

with open('converted.pdf', 'wb') as f:
    f.write(response.content)

Step 3: Handle the Response

Success Response

When successful, the API returns:
  • Status Code: 200 OK
  • Content-Type: application/pdf
  • Body: The converted PDF file as binary data

Error Responses

{
  "code": "INVALID_FILE_TYPE",
  "error": "Bad Request",
  "message": "Only DOCX files are supported",
  "requestId": "req_abc123"
}
  • MISSING_AUTH: No API key provided - INVALID_API_KEY: Invalid or expired API key - INVALID_FILE_TYPE: File is not a DOCX - FILE_TOO_LARGE: File exceeds 25MB limit - RATE_LIMIT_EXCEEDED: Too many requests

What’s Next?

Explore API Reference

Deep dive into all available endpoints and options

Error Handling

Learn how to handle errors gracefully

Rate Limits

Understand rate limits and best practices

SDKs

Use our official SDKs for easier integration